#include "csgbox.h"

CSGBox::CSGBox(double fXMin , double fXMax , double fYMin , double fYMax , double fZMin , double fZMax){
    //Constructs a box with the half planes passed.

    m_fXMin = fXMin;
    m_fXMax = fXMax;
    m_fYMin = fYMin;
    m_fYMax = fYMax;
    m_fZMin = fZMin;
    m_fZMax = fZMax;
}

double CSGBox::evaluateEquation(XYZ p){
    //Evaluates whether p is inside or outside the box.

    double dValue = (p.x <= m_fXMax && p.x >= m_fXMin &&
                   p.y <= m_fYMax && p.y >= m_fYMin &&
                   p.z <= m_fZMax && p.z >= m_fZMin) ? I_INSIDE : I_OUTSIDE;

    return dValue;
}
